
const schedule = require('node-schedule');
class A {
    constructor () {
        this.seconds = 0;
        this.minites = 0
        this.hours = 14;
        this.day = 25;
        this.time_index = 0;
        this.job = schedule.scheduleJob(`*/1 * * * * *`, async () => {
            this.test()
        })
    }
    test () {
            if (this.time >= Date.now() || this.time_index == 1) {
                this.job.reschedule(`*/15 * * * * *`);
                this.time = Date.now();
                this.time_index = 1;
            } else {
                this.time = new Date(`2021-8-${this.day % 30 + 1} ${this.hours % 60}:${this.minites % 60}:${this.seconds % 60}`).getTime();
                this.seconds += 15;
                this.minites = Math.floor(this.seconds / 60 );
                this.hours = Math.floor(this.minites / 60) + 14;
                this.day = Math.floor(this.hours / 24) + this.day;
            }
            console.log(formatDate(this.time));
    }
}

new A();

